<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.3.3/echarts.min.js"></script>
</head>
<body>
    <!-- //1.引入echarts.js
    //2.准备一个具备大小的dom
    //3.初始化echarts实例
    //4.设置option -->
    <div style="width: 600px;height: 400px;"></div>
    <script>
        var myChart = echarts.init(document.querySelector('div'));
        var option = {
            xAxis:{
                type:'value',
                data:['张三','李四','王五','闰土','小明','茅台','二妞','大强']
            },
            yAxis:{
                type:'category',
            },
            series:[
                    {
                        type:'bar',
                        data:[88,92,63,77,94,80,72,86],
                        markPoint:{
                            data:[
                                {type:'max',name:'最大值'},
                                {type:'min',name:'最小值'}
                            ]
                        },
                        markLine:{
                            data:[
                                {type:'average',name:'平均值'}
                            ]
                    },
                    label:{
                        show:true,
                        position:'top',
                        fromatter:'{C}'
                    },
                    barWidht:'60%',
                    barmaxWidht:'100%',
                }
                ]
           }
    
        myChart.setOption(option);
    </script>
</body>
</html>